home *** CD-ROM | disk | FTP | other *** search
/ Sounds Terrific 1 / Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso / modules / w / wmsortsd.mod < prev    next >
Encoding:
Text File  |  1994-08-04  |  4.1 KB  |  136 lines

  1. WMSORTSD.MOD
  2. Vortex Rouge #163 @5853
  3. Thu, Dec 5, 1991   5:09 pm
  4. -------    ---------     --------------        --------------       ---
  5.   --------    --------    ---  A mod  from the Winds Master   -----   ----
  6.  -----   -----  ----------     The Whirlwind of Information      ----- ---
  7. -----   -------    -------     8 pm Friday to 6 am Monday,   -----    ----
  8.   -------     ------------     (Weekends ONLY!) 765-3093.  ------    -----
  9.  ----     -------    ------                                   ---------
  10.    --------    -------------   I can be reached at 93 @5851 ---------   ---
  11. -----    --------    ----  -------    ---------      ---------     ------
  12.  
  13.  
  14. WMSORTSD.MOD
  15.  
  16. DESCRIPTION: This mod sorts your subs and directories
  17.  
  18.   This is a pretty simple mod that I created a little while ago and just
  19. now decided to distribute.  I am actually amazed that no one already made
  20. a mod to do the same thing this one does.  
  21.  
  22.   As it says above, it sorts the subs and dirs, like this:
  23.   
  24. instead of
  25.  
  26. 1 - General
  27. 2 - War Sub
  28. 3 - Ansi
  29. 4 - For Sale
  30.  
  31. it would be like this:
  32.  
  33. 1 - General
  34. 2 - Ansi
  35. 3 - For Sale
  36. 4 - War Sub
  37.  
  38. NOTE: I have made this mod skip the first sub 'cause I always like my 
  39. general sub first, but if you do not want it to do that it is easy to fix.
  40.  
  41.   This mod does not change the order of any information on disk, only what
  42. is in memory (specifically, what is in usub and udir)
  43.  
  44. ON WITH THE MOD!!
  45.  
  46. key
  47.   = original code
  48.   + added line
  49.   
  50. all changes are in UTILITY.C to function changedsl()
  51.  
  52. =       if ((s.anony & anony_ansi_only) && (!okansi()))
  53. =     ok=0;
  54. =       if (ok) 
  55. =       {
  56. =     if ((i1 % 10)==0)
  57. =       dc[dp++]=('0'+(i1/10));
  58. =     itoa(i1++,s1.keys,10);
  59. =     s1.subnum=i;
  60. =     usub[i2++]=s1;
  61. =       }
  62. =     }
  63. +     for (i=1; i<i2; i++)                /* see note */
  64. +       for (i1=i; i1<i2; i1++)
  65. +     if (strcmp(subboards[usub[i].subnum].name,
  66. +            subboards[usub[i1].subnum].name) > 0)
  67. +     {
  68. +       i3=usub[i].subnum;
  69. +       usub[i].subnum=usub[i1].subnum;
  70. +       usub[i1].subnum=i3;
  71. +     }
  72. =     i1=1;
  73. =     i2=0;
  74. =     for (i=0; i<num_dirs; i++) {
  75. =       ok=1;
  76. =       d=directories[i];
  77. =       if (thisuser.dsl<d.dsl)
  78. =     ok=0;
  79. =       if (thisuser.age<d.age)
  80. =     ok=0;
  81. =       if (d.dar)
  82. =     if ((d.dar & thisuser.dar)==0)
  83. =       ok=0;
  84. =       if (ok) {
  85. =     s1.subnum=i;
  86. =     if (i==0)
  87. =       strcpy(s1.keys,"0");
  88. =     else {
  89. =       if ((i1 % 10)==0)
  90. =         dcd[ddp++]=('0'+(i1/10));
  91. =       itoa(i1++,s1.keys,10);
  92. =     }
  93. =     udir[i2++]=s1;
  94. =       }
  95. =     }
  96. =
  97. +     for (i=1; i<i2; i++)            /* see note */
  98. +       for (i1=i; i1<i2; i1++)
  99. +     if (strcmp(directories[udir[i].subnum].name, 
  100. +            directories[udir[i1].subnum].name) > 0)
  101. +     {
  102. +       i3=udir[i].subnum;
  103. +       udir[i].subnum=udir[i1].subnum;
  104. +       udir[i1].subnum=i3;
  105. +     }
  106. =
  107. =     dcd[ddp]=0;
  108. =     dc[dp]=0;
  109. =   }
  110.  
  111. NOTE: Both for (i=1's are so it skips the first sub and first sub, since
  112. this is usually the General Sub/Sysop Dir which are usually wanted first.
  113. If you would like to skip the first two subs/dirs just change the 1 to 2,
  114. but if you would rather not skip any and alphabeticalize everything, change
  115. it to a 0.
  116.  
  117. One more note, I may have made some minor changes to the small areas of
  118. code above the area marked to be read in, but the changes (if any) were
  119. only to disreguard the keys variable 'cause I did not think the mod would
  120. work correctly if you used it, but it does work completely.
  121.  
  122.  
  123. FINAL NOTE:
  124.   As of right now, I am not allowed to use the computer till January 1st.
  125. (parent's aren't home).  Even though I will be allowed to use the computer
  126. and set my board back up after Jan 1 I am not planning on it.  This mod may
  127. be the last mod I will distribute.  If I find a time in the future, I may
  128. pull another mod from my source and post it.  I do have many undistributed
  129. mods that just might trickle out, but I will not create any more.
  130.  
  131.  
  132.                 Samuel R. Neff
  133.                     
  134.       7    <<=--       The Dark Side of the Moon BBS       --=>>
  135.     5   <<=--       Phone: 518-237-0489      Node: 5853       --=>>
  136.  2   <<=-- Home of 'The Gunners Dream' <Hunting/Gun Control> NET --=>>